<template>
  <div class="personal">
    <div class="zuo">
      <el-card class="box-card ">
        <div slot="header" class="clearfix">
          <span>个人信息</span>
        </div>
        <div class="demo-image__preview IMG">
          <el-image style="width: 100px; height: 100px;" :src="list.avatar" />
        </div>
        <el-divider />
        <!-- 显示信息部分 -->
        <div>
          <div class="qq">
            <i class="el-icon-user-solid">用户名称</i>
            <span>{{ list.nickName }}</span>
          </div>
          <el-divider />
          <div class="qq">
            <i class="el-icon-mobile-phone">手机号码</i>
            <span>{{ list.mobile }}</span>
          </div>
          <el-divider />
          <div class="qq">
            <i class="el-icon-message">用户邮箱</i>
            <span>{{ list.email }}</span>
          </div>
          <el-divider />
          <div class="qq">
            <i class="el-icon-s-data">所属部门</i>
            <span>{{ list.department }}</span>
          </div>
          <el-divider />
          <div class="qq">
            <i class="el-icon-s-custom">用户昵称</i>
            <span>{{ list.realName }}</span>
          </div>
          <el-divider />
          <el-collapse accordion style="color: black;">
            <el-collapse-item title="查看商户集合">
              <div class="enterprise">
                <el-image :src="list.avatar" /> <span @click="merchantDTOList">{{ list.nickName }}</span>
              </div>
              <el-divider />
            </el-collapse-item>
          </el-collapse>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
import { getUserInfo } from '@/api/user'
export default {
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getUserInfo()
  },
  methods: {
    async getUserInfo() {
      const res = await getUserInfo()
      this.list = res
    },
    merchantDTOList() {
      this.$router.push('/merchantDTOList/index')
    }
  }
}
</script>

<style lang="scss" scoped>

.zuo {
    width: 80%;
    margin: 0 auto;
    margin-top: 20px;
}

.img {
    border: 1px solid #fff;
    border-radius: 50%;
    margin-bottom: 10px;
}

.IMG {
    text-align: center;
}

.qq {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.imgs{
    width: 50px;
    height: 50px;
    border: 1px solid #fff;
    border-radius: 50%;
}
.enterprise{
    display: flex;
    width: 100%;
    height: 50px;
    justify-content: space-between;
  align-items: center; /* 垂直居中对齐 */
}
</style>
